package com.example.Dietproject.vegetables.servlce;

import com.example.Dietproject.vegetables.dao.Diet_vegetablesMapper;
import com.example.Dietproject.vegetables.entity.Diet_vegetables;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Diet_VegetableServlceImpl implements Diet_VegetableServlce {
    @Autowired
    private Diet_vegetablesMapper diet_vegetablesMapper;
    @Override
    public List<Diet_vegetables> selectByAll() {

        return diet_vegetablesMapper.selectByAll();
    }

    @Override
    public int insertSelective(Diet_vegetables record) {
        try {
            diet_vegetablesMapper.insertSelective(record);
            return 1;
        }catch (Exception e){
            e.getMessage();
        }
        return 0;
    }

    @Override
    public Diet_vegetables selectByPrimaryKey(Integer ificationid) {
        if (ificationid==null){
            return null;
        }else{
            return diet_vegetablesMapper.selectByPrimaryKey(ificationid);
        }
    }

    @Override
    public int updateByPrimaryKeySelective(Diet_vegetables record) {
        return diet_vegetablesMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int deleteByPrimaryKey(Integer ificationid) {
        return diet_vegetablesMapper.deleteByPrimaryKey(ificationid);
    }

}
